<!--
*Author：DGZ
 *Contact：jiduxiong@dagongzao.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/wmsproject/warehouse/Wms_Warehouse.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :details="details"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>  
<script>
    import extend from "@/extension/wmsproject/warehouse/Wms_Warehouse.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        name: "Wms_Warehouse",
        setup() {
            const table = ref({
                key: "WarehouseId",
                footer: "Foots",
                cnName: "仓库管理",
                name: "warehouse/Wms_Warehouse",
                newTabEdit: false,
                url: "/Wms_Warehouse/",
                sortName: "WarehouseId"
            });
            const editFormFields = ref({"WarehouseCode":"","WarehouseName":"","IsLocked":"","Remarks":""});
            const editFormOptions = ref([[{"title":"仓库编号","required":true,"field":"WarehouseCode"},
                               {"title":"仓库名称","required":true,"field":"WarehouseName"}],
                              [{"dataKey":"enabled","data":[],"title":"是否锁定","field":"IsLocked","colSize":2,"type":"switch"},
                               {"title":"备注","field":"Remarks","colSize":10,"type":"textarea"}]]);
            const searchFormFields = ref({"WarehouseCode":"","WarehouseName":""});
            const searchFormOptions = ref([[{"title":"仓库编号","field":"WarehouseCode","type":"like"},{"title":"仓库名称","field":"WarehouseName","type":"like"}]]);
            const columns = ref([{field:"WarehouseCode",title:"仓库编号",type:"string",link:true,width:120,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"WarehouseName",title:"仓库名称",type:"string",width:120,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"IsLocked",title:"是否锁定",type:"int",bind:{ key:"enabled",data:[]},width:120,showOverflowTooltip:true,align:"left"},
                       {field:"Remarks",title:"备注",type:"string",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"Creator",title:"创建人",type:"string",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyId",title:"修改用户",type:"bigint",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyTime",title:"修改时间",type:"datetime",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"CreateId",title:"创建用户",type:"bigint",width:120,hidden:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"WarehouseId",title:"ID",type:"bigint",width:120,hidden:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"Modifier",title:"修改人",type:"string",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"IsValid",title:"是否有效",type:"int",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"CreateTime",title:"创建时间",type:"datetime",width:120,showOverflowTooltip:true,align:"left"}]);
            const detail = ref({columns:[]});
            const details = ref([  { 
                    cnName: "库区管理",
                    table: "Wms_Zone",
                    columns: [{field:"ZoneId",title:"ID",type:"bigint",width:110,hidden:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"CreateId",title:"创建用户",type:"bigint",width:80,hidden:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"WarehouseId",title:"仓库",type:"bigint",bind:{ key:"WMS_Warehouse",data:[]},width:110,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"ZoneCode",title:"库区编码",type:"string",link:true,width:120,edit:{type:""},require:true,showOverflowTooltip:true,align:"left"},
                       {field:"ZoneName",title:"库区名称",type:"string",width:180,edit:{type:""},showOverflowTooltip:true,align:"left"},
                       {field:"Enabled",title:"是否启用",type:"int",bind:{ key:"enabled",data:[]},width:110,edit:{type:"switch"},showOverflowTooltip:true,align:"left"},
                       {field:"Remarks",title:"备注",type:"string",width:150,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"IsValid",title:"是否有效",type:"int",width:110,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Creator",title:"创建人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"CreateTime",title:"创建时间",type:"datetime",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyId",title:"修改用户",type:"bigint",width:80,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Modifier",title:"修改人",type:"string",width:100,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyTime",title:"修改时间",type:"datetime",width:110,hidden:true,showOverflowTooltip:true,align:"left"}],
                    sortName: "ZoneId",
                    key: "ZoneId",
                    buttons:[],
                    delKeys:[],
                    detail:null
                                            },
                    { 
                    cnName: "存放点管理",
                    table: "Wms_Position",
                    columns: [{field:"PositionId",title:"ID",type:"bigint",width:110,hidden:true,readonly:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"WarehouseId",title:"仓库ID",type:"bigint",bind:{ key:"WMS_Warehouse",data:[]},width:110,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"PositionCode",title:"定位点编码",type:"string",link:true,width:120,edit:{type:""},require:true,showOverflowTooltip:true,align:"left"},
                       {field:"Enabled",title:"是否启用",type:"int",bind:{ key:"enabled",data:[]},width:110,edit:{type:"switch"},showOverflowTooltip:true,align:"left"},
                       {field:"IsStockInPort",title:"是否入库口",type:"sbyte",bind:{ key:"enabled",data:[]},width:110,edit:{type:"switch"},require:true,showOverflowTooltip:true,align:"left"},
                       {field:"IsStockOutPort",title:"是否出库口",type:"sbyte",bind:{ key:"enabled",data:[]},width:110,edit:{type:"switch"},require:true,showOverflowTooltip:true,align:"left"},
                       {field:"StockInTunnel",title:"入库可达巷道;以逗号分割",type:"string",width:150,edit:{type:""},showOverflowTooltip:true,align:"left"},
                       {field:"StockOutTunnel",title:"出库可达巷道;以逗号分割",type:"string",width:150,edit:{type:""},showOverflowTooltip:true,align:"left"},
                       {field:"StockId",title:"关联库位",type:"bigint",bind:{ key:"WMS_Stock",data:[]},width:110,edit:{type:"select"},showOverflowTooltip:true,align:"left"},
                       {field:"Remarks",title:"备注",type:"string",width:150,showOverflowTooltip:true,align:"left"},
                       {field:"IsValid",title:"是否有效",type:"int",width:110,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"CreateId",title:"创建用户",type:"bigint",width:80,hidden:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"Creator",title:"创建人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"CreateTime",title:"创建时间",type:"datetime",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyId",title:"修改用户",type:"bigint",width:80,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Modifier",title:"修改人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyTime",title:"修改时间",type:"datetime",width:110,showOverflowTooltip:true,align:"left"}],
                    sortName: "PositionId",
                    key: "PositionId",
                    buttons:[],
                    delKeys:[],
                    detail:null
                                            }]);
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
                details
            };
        },
    });
</script>
